package com.exam.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.exam.entity.ExamManage;
import com.exam.entity.RespPageBean;
import com.exam.mapper.ExamManageMapper;
import com.exam.service.IExamManageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 考试管理表 服务实现类
 * </p>
 *
 * @author zyh
 * @since 2023-03-09
 */
@Service
public class ExamManageServiceImpl extends ServiceImpl<ExamManageMapper, ExamManage> implements IExamManageService {


    @Autowired(required = false)
    private ExamManageMapper examManageMapper;

    @Override
    public RespPageBean getExamManageByPage(Integer page, Integer size) {
        Page<ExamManage> iPage=new Page<>(page,size);
        IPage<ExamManage> examManageByPage = examManageMapper.getExamManageByPage(iPage);
        RespPageBean respPageBean=new RespPageBean(examManageByPage.getTotal(),examManageByPage.getRecords());
        return respPageBean;
    }
}
